<!-- 高德地图-模板 -->
<template>
  <div class="tp-amap">
    <el-dialog
      v-el-drag-dialog="{ drag: true, full: true, resize: true }"
      :title="title || '模板-高德地图显示'"
      :close-on-click-modal="false"
      :visible.sync="md.state"
      @close="closeMd"
      v-if="md.state"
      append-to-body
    >
      <MyAmap v-on:getAmapData="getAmapData" />
    </el-dialog>
  </div>
</template>

<script>
import elDragDialog from "@/directive/el-drag-dialog";
import MyAmap from "@/components/MyAmap";

export default {
  name: "TpAmap",
  components: { MyAmap },
  directives: { elDragDialog },
  props: ["state",'title'],
  data() {
    return {
      md: { state: this.state },
    };
  },
  methods: {
    /* 关闭弹框 */
    closeMd() {
      this.$emit("getMdState", false);
    },
    getAmapData(data) {
      this.$emit("getMapData", data);
    },
  },
};
</script>

<style scoped>
</style>